﻿CREATE TABLE [dbo].[Project_Task] (
    [Id]                 INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [FId]                UNIQUEIDENTIFIER NULL,
    [TaskId]             UNIQUEIDENTIFIER CONSTRAINT [DF_Project_Task_TaskId] DEFAULT (newid()) ROWGUIDCOL NULL,
    [OrderId]            UNIQUEIDENTIFIER NULL,
    [ProjectId]          UNIQUEIDENTIFIER NULL,
    [ProjectName]        NVARCHAR (50)    NULL,
    [ProductId]          INT              CONSTRAINT [DF_Project_Task_ProductId] DEFAULT ((0)) NULL,
    [CusName]            NVARCHAR (200)   NULL,
    [Title]              NVARCHAR (50)    NULL,
    [WebType]            SMALLINT         CONSTRAINT [DF_Project_Task_WebType] DEFAULT ((0)) NOT NULL,
    [Description]        VARCHAR (MAX)    NULL,
    [DownPerson]         NVARCHAR (50)    NULL,
    [DownPersonName]     NVARCHAR (50)    NULL,
    [ExecDepartmentId]   INT              NULL,
    [ExecDepartmentName] NVARCHAR (50)    NULL,
    [ExecPerson]         NVARCHAR (50)    NULL,
    [ExecPersonName]     NVARCHAR (50)    NULL,
    [StartDate]          DATETIME         NULL,
    [EndDate]            DATETIME         NULL,
    [IsFinish]           BIT              CONSTRAINT [DF_Project_Task_IsFinish] DEFAULT ((0)) NULL,
    [CreateDate]         DATETIME         CONSTRAINT [DF_Project_Task_CreateDate] DEFAULT (getdate()) NULL,
    [StateId]            INT              CONSTRAINT [DF_Project_Task_StateId] DEFAULT ((0)) NULL,
    [CompanyId]          INT              NULL,
    [TypeId]             INT              NULL,
    CONSTRAINT [PK_Project_Task] PRIMARY KEY CLUSTERED ([Id] ASC) WITH (FILLFACTOR = 90)
);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_OrderId]
    ON [dbo].[Project_Task]([OrderId] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_TaskId]
    ON [dbo].[Project_Task]([TaskId] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_DownPerson]
    ON [dbo].[Project_Task]([DownPerson] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_ExecPerson]
    ON [dbo].[Project_Task]([ExecPerson] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_CreateDate]
    ON [dbo].[Project_Task]([CreateDate] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_ProjectId]
    ON [dbo].[Project_Task]([ProjectId] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [IX_Project_Task_WebType]
    ON [dbo].[Project_Task]([WebType] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [idx_Project_Task_WebType_IncludeIndex]
    ON [dbo].[Project_Task]([WebType] ASC, [CreateDate] ASC)
    INCLUDE([Id], [TaskId], [OrderId], [ProjectId], [CusName], [Title], [DownPersonName], [ExecPerson], [ExecPersonName], [StartDate], [EndDate], [IsFinish]) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Project_Task_edffbd97aa904f6e960426f9dd603820]
    ON [dbo].[Project_Task]([TaskId] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Project_Task_50f42b7f30044c9881e21dfd5a0f93d0]
    ON [dbo].[Project_Task]([FId] ASC) WITH (FILLFACTOR = 90);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Project_Task_4438a04794a548a9be24a35abfdbada3]
    ON [dbo].[Project_Task]([ExecPerson] ASC, [CreateDate] ASC)
    INCLUDE([CusName], [Title], [IsFinish]) WITH (FILLFACTOR = 90);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'0与网站无关 1~8网站开发的8种任务', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_Task', @level2type = N'COLUMN', @level2name = N'WebType';

